import request from '@/config/axios'

// APP 版本 VO
export interface AppVersionVO {
  id: number | string // 唯一编号
  versionCode: number // 版本代号
  versionName: string // 版本名称
  content: string // 更新内容
  url: string // 下载地址
}

// APP 版本 API
export const AppVersionApi = {
  // 查询APP 版本分页
  getAppVersionPage: async (params: any) => {
    return await request.get({ url: `/cms/app-version/page`, params })
  },

  // 查询APP 版本详情
  getAppVersion: async (id: number | string) => {
    return await request.get({ url: `/cms/app-version/get?id=` + id })
  },

  // 新增APP 版本
  createAppVersion: async (data: AppVersionVO) => {
    return await request.post({ url: `/cms/app-version/create`, data })
  },

  // 修改APP 版本
  updateAppVersion: async (data: AppVersionVO) => {
    return await request.post({ url: `/cms/app-version/update`, data })
  },

  // 删除APP 版本
  deleteAppVersion: async (id: number | string) => {
    return await request.get({ url: `/cms/app-version/delete?id=` + id })
  },

  // 导出APP 版本 Excel
  exportAppVersion: async (params: any) => {
    return await request.download({ url: `/cms/app-version/export-excel`, params })
  }
}
